$OpenBSD: patch-src_Sequence_cpp,v 1.6 2009/10/28 18:40:13 jakemsr Exp $
--- src/Sequence.cpp.orig	Mon Aug 31 03:45:39 2009
+++ src/Sequence.cpp	Sat Oct 17 14:29:54 2009
@@ -947,7 +947,8 @@ bool Sequence::Get(samplePtr buffer, sampleFormat form
                    sampleCount start, sampleCount len) const
 {
    if (start < 0 || start > mNumSamples ||
-       start+len > mNumSamples)
+       start+len > mNumSamples ||
+       (format != mSampleFormat) || !buffer)
       return false;
    int b = FindBlock(start);
 
@@ -981,6 +982,7 @@ bool Sequence::Set(samplePtr buffer, sampleFormat form
    if (format != mSampleFormat) {
       temp = NewSamples(mMaxSamples, mSampleFormat);
       wxASSERT(temp);
+      return false;
    }
 
    samplePtr silence = NULL;
@@ -988,6 +990,7 @@ bool Sequence::Set(samplePtr buffer, sampleFormat form
       silence = NewSamples(mMaxSamples, format);
       wxASSERT(silence);
       ClearSamples(silence, format, 0, mMaxSamples);
+      return false;
    }
 
    int b = FindBlock(start);
